package com.sky.mapper;

import com.sky.entity.DishFlavor;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

/**
 * ClassName: dishFlavorMapper
 * Description: com.sky.mapper
 */
@Mapper
public interface DishFlavorMapper {


    /**
     * 向口味表插入n条数据
     * @param flavors
     */
    void insertBatch(List<DishFlavor> flavors);

    /**
     * 删除菜品口味表中的数据
     * @param dishId
     */
    @Delete("delete from dish_flavor where dish_id = #{dishId}")
    void deleteByDishId(Long dishId);

    /**
     * 查询口味列表
     * @param id
     * @return
     */
    List<DishFlavor> getFlavorsByDishId(Long id);
}
